const express = require("express");

const app = express();

app.use(express.static("./public"));

// API
// 中间件路由
// xhr.open('GET','http://127.0.0.1:3000/a/100?a=1&b=2')
app.get("/a/:id", (req, res) => {
  res.send({
    query: req.query,
    params: req.params,
  });
});

app.listen(3000, () => {
  console.log("success", "http://127.0.0.1:3000");
});
